﻿Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports Seuss.EnterpriseLibrary.DataAccess
Imports Seuss.EnterpriseLibrary.BusinessLogic
Imports System.Web
Imports System.Data


Partial Class Consulta_PA_AlumnoCurriculo
    Inherits System.Web.UI.Page

    Dim cPerCodigo As String

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Response.Expires = -1
        Response.AddHeader("Pragma", "no-cache")
        Response.AddHeader("cache-control", "private")
        Response.CacheControl = "no-cache"
        cPerCodigo = Request.QueryString("cPerCodigo")

       lblcPercodigo.Text = cPerCodigo
        Call CargarPerAluRegistra()
        If Not Page.IsPostBack Then
            Using Seguridad As New BLL_Administracion
                Seguridad.Set_Transaccion_Insert(Nothing, 100401, IdentityUser.UserCode, My.Request.UserHostAddress.ToString, CrearXMLTransaccion("Consulta Pagina Movil", "/Pagina|" + My.Request.Url.Segments(My.Request.Url.Segments.Length - 1).ToString))
            End Using
        End If
    End Sub

    Private Sub CargarPerAluRegistra()
        Dim ldr As New List(Of IDataReader)
        Dim DivPrincipal As New StringBuilder

        DivPrincipal.Append("<table style='width:100%;'>")
        DivPrincipal.Append("<tr style='color:#FFFFFF;'>")
        DivPrincipal.Append("   <td style='background-color:#666666;font-size:8px;width:40%;'>Escuela</td>")
        DivPrincipal.Append("   <td style='background-color:#666666;font-size:8px;'>Cod. Univ.</td>")
        DivPrincipal.Append("   <td style='background-color:#666666;font-size:8px;'>Estado</td>")
        DivPrincipal.Append("   <td style='font-size:10px;'></td>")
        DivPrincipal.Append("</tr>")

        Using ObjPool As New PoolDbCommand()
            Dim ObjUsuario As New DAL_Kiosco(ObjPool.Database)
            ObjPool.AddDbCommand(ObjUsuario.Get_UO_by_cPerCodigo(lblcPercodigo.Text), PoolDbCommand.PoolDbCommandResultType.Query)
            ObjPool.Pooling(Nothing, ldr, True)
            ObjUsuario = Nothing
            While ldr(0).Read
                DivPrincipal.Append("<tr>")
                DivPrincipal.Append("   <td style='font-size:8px;'>" + ldr(0).Item("cUniOrgNombre").ToString + "</td>")
                DivPrincipal.Append("   <td style='font-size:8px;'>" + ldr(0).Item("codigo").ToString + "</td>")
                DivPrincipal.Append("   <td style='font-size:8px;text-align:center'>" + ldr(0).Item("nPerAluRegEstado").ToString + "</td>")
                DivPrincipal.Append("   <td style='font-size:8px;'><a href=""./PA_InfoEcon.aspx?CodUniv=" + LTrim(RTrim(ldr(0).Item("codigo").ToString)) + "&Filial=" + ldr(0).Item("cPerJuridica").ToString + "&cPercodigo=" + lblcPercodigo.Text + """ ><img src='../Imagenes/Ok.gif' border='0'/><a></td>")
                DivPrincipal.Append("</tr>")
            End While
        End Using

        DivPrincipal.Append("</table>")
        lblPerAluRegistra.Text = DivPrincipal.ToString
    End Sub
End Class
